package com.qf.medicaldoctoradmin.healthMonitor.drugInfo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.qf.common.entity.DrugInfo;
import com.qf.medicaldoctoradmin.healthMonitor.drugInfo.dao.DrugInfoDao;
import com.qf.medicaldoctoradmin.healthMonitor.drugInfo.param.DrugInfoParam;
import com.qf.medicaldoctoradmin.healthMonitor.drugInfo.service.DrugInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DrugInfoServiceImpl implements DrugInfoService {
    @Resource
    private DrugInfoDao drugInfoDao;

    @Override
    public List<DrugInfo> getList(String drugName) {
        List<DrugInfo> drugInfos = drugInfoDao.selectList(new LambdaQueryWrapper<DrugInfo>()
                .like(DrugInfo::getDrugName, drugName));

        if (drugInfos == null) {
            throw new RuntimeException("空空如也");
        }

        return drugInfos;
    }

}
